home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / uriloader / nsITransfer.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  6KB  |  146 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsITransfer.idl
  3.  */
  4.  
  5. #ifndef __gen_nsITransfer_h__
  6. #define __gen_nsITransfer_h__
  7.  
  8.  
  9. #ifndef __gen_nsIWebProgressListener2_h__
  10. #include "nsIWebProgressListener2.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIURI; /* forward declaration */
  18.  
  19. class nsICancelable; /* forward declaration */
  20.  
  21. class nsIMIMEInfo; /* forward declaration */
  22.  
  23. class nsILocalFile; /* forward declaration */
  24.  
  25.  
  26. /* starting interface:    nsITransfer */
  27. #define NS_ITRANSFER_IID_STR "23c51569-e9a1-4a92-adeb-3723db82ef7c"
  28.  
  29. #define NS_ITRANSFER_IID \
  30.   {0x23c51569, 0xe9a1, 0x4a92, \
  31.     { 0xad, 0xeb, 0x37, 0x23, 0xdb, 0x82, 0xef, 0x7c }}
  32.  
  33. class NS_NO_VTABLE nsITransfer : public nsIWebProgressListener2 {
  34.  public: 
  35.  
  36.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITRANSFER_IID)
  37.  
  38.   /**
  39.      * Initializes the transfer with certain properties.  This function must
  40.      * be called prior to accessing any properties on this interface.
  41.      *
  42.      * @param aSource The source URI of the transfer. Must not be null.
  43.      *
  44.      * @param aTarget The target URI of the transfer. Must not be null.
  45.      *
  46.      * @param aDisplayName The user-readable description of the transfer.
  47.      *                     Can be empty.
  48.      *
  49.      * @param aMIMEInfo The MIME info associated with the target,
  50.      *                  including MIME type and helper app when appropriate.
  51.      *                  This parameter is optional.
  52.      *
  53.      * @param startTime Time when the download started (ie, when the first
  54.      *                  response from the server was received)
  55.      *                  XXX presumably wbp and exthandler do this differently
  56.      *
  57.      * @param aTempFile The location of a temporary file; i.e. a file in which
  58.      *                  the received data will be stored, but which is not
  59.      *                  equal to the target file. (will be moved to the real
  60.      *                  target by the caller, when the download is finished)
  61.      *                  May be null.
  62.      *
  63.      * @param aCancelable An object that can be used to abort the download.
  64.      *                    Must not be null.
  65.      *                    Implementations are expected to hold a strong
  66.      *                    reference to this object until the download is
  67.      *                    finished, at which point they should release the
  68.      *                    reference.
  69.      */
  70.   /* void init (in nsIURI aSource, in nsIURI aTarget, in AString aDisplayName, in nsIMIMEInfo aMIMEInfo, in PRTime startTime, in nsILocalFile aTempFile, in nsICancelable aCancelable); */
  71.   NS_IMETHOD Init(nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime startTime, nsILocalFile *aTempFile, nsICancelable *aCancelable) = 0;
  72.  
  73. };
  74.  
  75. /* Use this macro when declaring classes that implement this interface. */
  76. #define NS_DECL_NSITRANSFER \
  77.   NS_IMETHOD Init(nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime startTime, nsILocalFile *aTempFile, nsICancelable *aCancelable); 
  78.  
  79. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  80. #define NS_FORWARD_NSITRANSFER(_to) \
  81.   NS_IMETHOD Init(nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime startTime, nsILocalFile *aTempFile, nsICancelable *aCancelable) { return _to Init(aSource, aTarget, aDisplayName, aMIMEInfo, startTime, aTempFile, aCancelable); } 
  82.  
  83. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  84. #define NS_FORWARD_SAFE_NSITRANSFER(_to) \
  85.   NS_IMETHOD Init(nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime startTime, nsILocalFile *aTempFile, nsICancelable *aCancelable) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aSource, aTarget, aDisplayName, aMIMEInfo, startTime, aTempFile, aCancelable); } 
  86.  
  87. #if 0
  88. /* Use the code below as a template for the implementation class for this interface. */
  89.  
  90. /* Header file */
  91. class nsTransfer : public nsITransfer
  92. {
  93. public:
  94.   NS_DECL_ISUPPORTS
  95.   NS_DECL_NSITRANSFER
  96.  
  97.   nsTransfer();
  98.  
  99. private:
  100.   ~nsTransfer();
  101.  
  102. protected:
  103.   /* additional members */
  104. };
  105.  
  106. /* Implementation file */
  107. NS_IMPL_ISUPPORTS1(nsTransfer, nsITransfer)
  108.  
  109. nsTransfer::nsTransfer()
  110. {
  111.   /* member initializers and constructor code */
  112. }
  113.  
  114. nsTransfer::~nsTransfer()
  115. {
  116.   /* destructor code */
  117. }
  118.  
  119. /* void init (in nsIURI aSource, in nsIURI aTarget, in AString aDisplayName, in nsIMIMEInfo aMIMEInfo, in PRTime startTime, in nsILocalFile aTempFile, in nsICancelable aCancelable); */
  120. NS_IMETHODIMP nsTransfer::Init(nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime startTime, nsILocalFile *aTempFile, nsICancelable *aCancelable)
  121. {
  122.     return NS_ERROR_NOT_IMPLEMENTED;
  123. }
  124.  
  125. /* End of implementation class template. */
  126. #endif
  127.  
  128. /**
  129.  * A component with this contract ID will be created each time a download is
  130.  * started, and nsITransfer::Init will be called on it and an observer will be set.
  131.  *
  132.  * Notifications of the download progress will happen via
  133.  * nsIWebProgressListener/nsIWebProgressListener2.
  134.  *
  135.  * INTERFACES THAT MUST BE IMPLEMENTED:
  136.  *   nsITransfer
  137.  *   nsIWebProgressListener
  138.  *   nsIWebProgressListener2
  139.  *
  140.  * XXX move this to nsEmbedCID.h once the interfaces (and the contract ID) are
  141.  * frozen.
  142.  */
  143. #define NS_TRANSFER_CONTRACTID "@mozilla.org/transfer;1"
  144.  
  145. #endif /* __gen_nsITransfer_h__ */
  146.